

# 40.组合总和II


def main(candidates,target):
    result = []
    temp = []
    candidates.sort()
    def backtrack(candidates,target,startIndex):
        sum = 0
        for j in range(0,len(temp)):
            sum = sum + temp[j]
        if sum == target:
            result.append(temp[:])
            return
        if sum > target:
            return
        for i in range(startIndex,len(candidates)):
            if i > startIndex & candidates[i] == candidates[i - 1]:
                continue
            temp.append(candidates[i])
            used[i] = True
            backtrack(candidates,target,i+1)
            temp.pop()
            used[i] = False
    backtrack(candidates,target,used,0)
    # for i in range(0,len(result)):
    #     result[i].sort()
    # results = []
    # for i in range(0,len(result)):
    #     if result[i] not in results:
    #         results.append(result[i])
    if len(result) == 0:
        return []
    else:
        return result

if  __name__ == "__main__":
    arr = input()
    candidates = [int(i) for i in arr.split()]
    target = int(input())
    result = main(candidates,target)
    print(result)
